package com.example.utils;

import org.aspectj.apache.bcel.classfile.Code;
import org.springframework.util.concurrent.SuccessCallback;

import com.example.bean.Result;
import com.example.enums.CodeEnum;

import net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.ResubmissionScheduler;

/**
 * @author edehhjn
 * 返回结果封装处理工具
 */
public class ResultUtil {

	public static Result success(Object object) {
		Result result = new Result();
		result.setCode(CodeEnum.SUCCESS_US.getCode());
		result.setMsg(CodeEnum.SUCCESS_US.getMsg());
		result.setData(object);
		return result;
	}
	
	public  static Result error(Integer code,String msg) {
		Result result = new Result();
		result.setCode(code);
		result.setMsg(msg);
		return result;
	}
	
	
}
